package day5

object Test2_Sorted {
  def main(args: Array[String]): Unit = {

    val arr = List(2, 4, 1, 9, 6, 7)
    val i1: List[Int] = arr.sorted
    val i2: List[Int] = arr.sorted.reverse
    println(i2)
    println(i1)

    val list1 = List(("zs", 22), ("lisi", 27), ("wb", 24))
    val list2: List[(String, Int)] = list1.sortBy((v: (String, Int)) => v._2).reverse
    println(list2)

    val list3 = List(("zs", 22,90), ("lisi", 27,77), ("wb", 24,55))
    val list4: List[(String, Int, Int)] = list3.sortBy((vv: (String, Int, Int)) => vv._3 % 2)
    println(list4)
  }
}
